<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="java.sql.*" %>
<%@ page contentType="text/html; charset=utf-8"%>
<jsp:useBean id="dbbean" class="bean.dbbean"></jsp:useBean>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" contentType="text/html; charset=utf-8">
<title>回复展示</title>
</head>
<body>
<%
        String name=(String)session.getAttribute("username");
		
        if(name==null||name.equals("")){
        response.sendRedirect("login.jsp");
        }
     %> 
 <%
      String reply,time;
    String subject=request.getParameter("subject");
    Connection conn=dbbean.getConn();
	Statement smt=conn.createStatement();
    String mysql="select * from reply where subject=?";
   PreparedStatement pst=conn.prepareStatement(mysql);
   pst.setString(1,subject);
   ResultSet rs;
      rs=pst.executeQuery();
      out.print("<center>"); 
      out.print("<table border=1>");
      out.print("<tr>");
      out.print("<td bgcolor=yellow>回复人姓名</td>");
      out.print("<td bgcolor=yellow>主题</td>");
      out.print("<td bgcolor=yellow>回复时间</td>");
      out.print("<td bgcolor=yellow>回复内容</td>");  
      while(rs.next()) 
    { 
    name=rs.getString(1); 
    subject=rs.getString(2); 
    reply=rs.getString(3);  
    time=rs.getString(4); 
 
out.print("<tr>");
out.print("<td>"+name+"</td>"); 
out.print("<td>"+subject+"</td>"); 
out.print("<td>"+reply+"</td>"); 
out.print("<td>"+time+"</td>");
out.print("</tr>");

} 

out.print("</table><p>"); 
out.print("<a href='shownote.jsp'>返回查看留言页面</a>");
 %>
</body>
</html>